﻿#include "mainwindow.h"
#include "ui_mainwindow.h"
#include <QScreen>
#include <QGuiApplication>
#include <QScrollBar>
#include <QDebug>
#undef print
#define print qDebug()
MainWindow::MainWindow(QWidget *parent)
    : QMainWindow(parent)
    , ui(new Ui::MainWindow)
{
    ui->setupUi(this);

    //resize(QGuiApplication::primaryScreen()->availableSize() * 3 / 4);
    setWindowState(Qt::WindowMaximized);
    ui->tabWidget->clear();
}

MainWindow::~MainWindow()
{
    if(session)
        delete session;
    delete ui;
}


void MainWindow::on_actionNew_Session_triggered()
{
    libsshParams *param=new libsshParams;
    param->host = "192.168.133.196";
    param->port=22;
    param->userName="yhj";
    param->passWord="123456";
    session = new qTerminalWidget();
    ui->tabWidget->addTab(session,"ssh:"+param->host+QString::asprintf(":%d",param->port));
    session->setFocusSlots();
    session->connectSsh(param);
}
